package com.cskaoyan.chapter0502.c050201;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * @Author:WalterChan
 * @Decription:Employee
 * @Date Created in 2024-05-19-15:31
 */
public class Employee {
    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", salary=" + salary +
                ", hireDay=" + hireDay +
                '}';
    }
    private String name;
    private BigDecimal salary;
    private Date hireDay;
    @Override
    public boolean equals(Object obj) {
        if (this==obj){
            return true;
        }
        if (obj==null){
            return false;
        }
        if (obj.getClass()!=getClass()){
            return false;
        }
        Employee other=(Employee)obj;
        return Objects.equals(other.name,name)&&Objects.equals(other.hireDay,hireDay)&&salary.compareTo(other.salary)==0;

    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getSalary() {
        return salary;
    }

    public void setSalary(BigDecimal salary) {
        this.salary = salary;
    }

}
